package lab02.test15;
public class Graduate implements TeacherInterface,StudentInterface{
    //属性：name（姓名），sex（性别），age（年龄），fee（每学期学费） pay（月工资）
    String name;
    String sex;
    int age;
    double fee;
    double pay;
    //构造函数
    Graduate( String name,double fee,double pay){
        this.name=name;
        this.fee=fee;
        this.pay=pay;
        if((this.pay-this.fee)<2000)
            System.out.println("You  need a loan!");
        else
            System.out.println("You income is enough！");
    }

    //行为：实现StudentInterface接口和TeacherInterface接口
    @Override
    public double setPay() {
        return this.pay=pay;
    }

    @Override
    public double getPay() {
        return this.pay*12;
    }

    @Override
    public double setFee() {
        return this.fee=fee;
    }

    @Override
    public double getFee() {
        return this.fee;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSex() {
        return sex;
    }
}
